package com.yfree.config

import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

object YConfig {
    var DEBUG = false
    var defaultFallback = "熔断成功:yfree_defaultFallback"

    object Request {
        var allowedOrigins = arrayOf<String>() // 跨域配置
        var filterCallBack = { request: HttpServletRequest, response: HttpServletResponse, handle: Any -> true } // 请求头拦截
    }

    object Response {
        var successCode = 1 // 成功码
        var fallBackCode = 403 // 降级熔断码
        var successMsg = "success" // 成功信息
        var errorCallBack = { e: Exception -> "" } // 错误拦截
    }

    object Encrypt {
        var enable = false
        var key = "0000000000000000"
    }

    object Socket {
        var host = ""
        var port = 0
    }
}
